package corejava2;

public class GenericMethod {
    public static void main(String[] args) {
        Integer[] a = new Integer[]{1, 2, 3};
        Double[] b = new Double[]{2.0, 3.0};
        String[] c = new String[]{"hello", "world"};
        printArray(a);
        printArray(b);
        printArray(c);
    }

    private static<T> void printArray(T[] arr) {
        for (T obj : arr)
            System.out.println(obj);
    }

}
